import express from "express";
import cors from "cors";
import queryDataList from "./serverUse/getMockData.js";
import queryDataListDynamic from "./serverUse/getMockDataDynamic.js";
// const express = require('express')
// 导入 cors 中间件
// const cors = require('cors')
const app = express();
const port = 8000;
// 将 cors 注册为全局中间件
app.use(cors());

// 配置解析表单数据的中间件
app.use(express.json());
app.use(express.urlencoded({ extended: false }));

// const queryDataList = require('./serverUse/getMockData')
app.use("/api", queryDataList);
app.use("/api", queryDataListDynamic);


// 监听端口
app.listen(port, () => {
    console.log(`Server is running on http://localhost:${port}`);
});
